function [A]= getfeature (B)

fids = fopen('g_out.ndx');

C = textscan(fids, '%d,%d,%d,%d,%d,%d' );

abc_num = [C{1,1}(B) C{1,2}(B) C{1,3}(B) C{1,4}(B) C{1,5}(B) C{1,6}(B)]
% for n = 0:(B-1)
% abc = fgetl(fids);
% end

% abc_num = str2num(abc);

switch abc_num(2)
    case 1
        A = ones([14 35])*0;
        for i=abc_num(3):floor((abc_num(3)+abc_num(5))/2)
               for j = abc_num(4):abc_num(6)
                A(i,j) = 1;
               end
        end
        for i= ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = abc_num(4):abc_num(6)
                A(i,j) = -1;
               end
        end  

        
    case 2
        A = ones([14 35])*0;
        for i=abc_num(3):abc_num(5)
               for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = 1;
               end
        end
        for i= abc_num(3):abc_num(5)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = -1;
               end
        end
        
    case 3
        A = ones([14 35])*0;
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/3)
            for j = abc_num(4):abc_num(6)
                A(i,j) = 1;
            end
        end
         for i = ceil((abc_num(3)+abc_num(5))/3):floor(2*(abc_num(3)+abc_num(5))/3)
            for j = abc_num(4):abc_num(6)
                A(i,j) = -1;
            end
         end
         for i = ceil(2*(abc_num(3)+abc_num(5))/3):abc_num(5)
            for j = abc_num(4):abc_num(6)
                A(i,j) = 1;
            end
         end
        
        
    case 4
        A = ones([14 35])*0;
        for i = abc_num(3):abc_num(5)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/3)
                A(i,j) = 1;
            end
        end
         for i = abc_num(3):abc_num(5)
            for j = ceil((abc_num(4)+abc_num(6))/3):floor(2*(abc_num(4)+abc_num(6))/3)
                A(i,j) = -1;
            end
         end
         for i = abc_num(3):abc_num(5)
            for j = ceil(2*(abc_num(4)+abc_num(6))/3):abc_num(6)
                A(i,j) = 1;
            end
         end
        
        
    case 5
        A = ones([14 35])*0;
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = 1;
            end
        end
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = -1;
            end
        end
        for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = -1;
            end
        end
          for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = 1;
            end
        end
        
    case 6
        A = ones([14 35])*0;
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = 1;
            end
        end
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = -1;
            end
        end
        for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = -1;
            end
        end
          for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = - 1;
            end
          end
    case 7
        A = ones([14 35])*0;
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = -1;
            end
        end
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = 1;
            end
        end
        for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = -1;
            end
        end
          for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = - 1;
            end
          end
        
    case 8
        A = ones([14 35])*0;
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = -1;
            end
        end
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = -1;
            end
        end
        for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = 1;
            end
        end
          for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = - 1;
            end
          end
        
    case 9
        A = ones([14 35])*0;
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = -1;
            end
        end
        for i = abc_num(3):floor((abc_num(3)+abc_num(5))/2)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = -1;
            end
        end
        for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = abc_num(4):floor((abc_num(4)+abc_num(6))/2)
                A(i,j) = -1;
            end
        end
          for i = ceil((abc_num(3)+abc_num(5))/2):abc_num(5)
            for j = ceil((abc_num(4)+abc_num(6))/2):abc_num(6)
                A(i,j) = 1;
            end
        end
        
end